{
 "metadata": {
  "name": "",
  "signature": "sha256:095815ad54b57ea8298eb17c778af2197f02125125db6d8a1b4bec9dc62cc837"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "train_dataset_args={'partition': 1048576000, 'random': True, 'stream': True}\n",
      "train_dataset='/home/lahiru/tutorials/valid.pfile'\n",
      "from io_func.pfile_io import read_data_args, read_dataset\n",
      "train_sets, train_xy, train_x, train_y, train_utt, train_frame = read_dataset(train_dataset, train_dataset_args)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "train_frame.eval()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "array([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,\n",
        "        13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,\n",
        "        26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,\n",
        "        39,  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,\n",
        "        52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,  64,\n",
        "        65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,\n",
        "        78,  79,  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,\n",
        "        91,  92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103,\n",
        "       104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,\n",
        "       117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,\n",
        "       130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,\n",
        "       143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,\n",
        "       156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,\n",
        "       169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,\n",
        "       182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,\n",
        "       195, 196, 197, 198, 199, 200, 201], dtype=int32)"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "train_sets.load_next_partition(train_xy)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "ValueError",
       "evalue": "too many values to unpack",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
        "\u001b[1;32m<ipython-input-7-8a64d32135bd>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtrain_sets\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mload_next_partition\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtrain_xy\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[1;32m/home/lahiru/PycharmProjects/dnn_tool/pdnn/io_func/pfile_io.py\u001b[0m in \u001b[0;36mload_next_partition\u001b[1;34m(self, shared_xy)\u001b[0m\n\u001b[0;32m    295\u001b[0m     \u001b[1;31m# load the n-th (0 indexed) partition to the GPU memory\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    296\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mload_next_partition\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mshared_xy\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 297\u001b[1;33m         \u001b[0mshared_x\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mshared_y\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mshared_xy\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    298\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    299\u001b[0m         \u001b[1;31m# read one partition from disk\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
        "\u001b[1;31mValueError\u001b[0m: too many values to unpack"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}